package com.fa.service;

import com.fa.mapper.DatabaseMetadataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DatabaseMetadataService {

    @Autowired
    private DatabaseMetadataMapper databaseMetadataMapper;

    // 获取所有表名
    public List<String> getAllTables(String databaseName) {
        return databaseMetadataMapper.getAllTables(databaseName);
    }

    // 获取指定表的元数据信息
    public List<Map<String, String>> getTableMetadata(String databaseName, String tableName) {
        return databaseMetadataMapper.getTableMetadata(databaseName, tableName);
    }
}
